package com.goktech.olala.server.dao.sys;

import com.goktech.olala.server.pojo.sys.SysCity;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wusq
 * 系统城市 dao
 */
public interface SysCityDao {
    /**
     * 删除
     * @param cityId
     * @return
     */
    int deleteByPrimaryKey(Integer cityId);

    /**
     * 新增
     * @param record
     * @return
     */
    int insert(SysCity record);

    /**
     * 查询
     * @param cityId
     * @return
     */
    SysCity selectByPrimaryKey(Integer cityId);

    /**
     * 查询全部
     * @return
     */
    List<SysCity> selectAll();

    /**
     * 更新
     * @param record
     * @return
     */
    int updateByPrimaryKey(SysCity record);

    /**
     * 通过code查询
     * @param cityCode
     * @return
     */
    @Select("SELECT CITY_ID cityId, CITY_CODE cityCode, CITY_NAME cityName FROM `SYS_CITY` WHERE CITY_CODE = #{cityCode}")
    SysCity selectByCode(String cityCode);
}